package edu.ptu.shortlink.admin.controller;


import edu.ptu.shortlink.admin.common.convention.result.Result;
import edu.ptu.shortlink.admin.remote.ShortLinkRemoteService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: shortlink
 * @BelongsPackage: edu.ptu.shortlink.project.controller
 * @Author: HYJ
 * @CreateTime: 2025-05-01  14:57
 * @Description: 获取短链接标题控制层
 * @Version: 1.0
 */
@RestController
@RequiredArgsConstructor
public class UrlTileController {

   private final ShortLinkRemoteService shortLinkRemoteService;

    /**
     * 获取url标题
     */
    @GetMapping("/api/short-link/admin/v1/title")
    public Result<String> getUrlTitle(@RequestParam("url") String url) {
        return shortLinkRemoteService.getUrlTitle(url);
    }
}
